﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" 
  Inherits="System.Web.Mvc.ViewPage<Colaboradores.Models.Cls_ListaFunc>" %>

<asp:Content ID="funcTitle" ContentPlaceHolderID="TitleContent" runat="server">
    Funcionário
</asp:Content>

<asp:Content ID="funcContent" ContentPlaceHolderID="MainContent" runat="server">
    <h2>Funcionário</h2>
    <%= Html.ActionLink("Cadastrar Novo Funcionário", "Novo", "Func") %>
    <br /> <br />
    <% using (Html.BeginForm()) {%>
        <fieldset>
            <h3>Pesquisar</h3>
            
            <%= Html.RadioButton("Tipo", "Mat", true) %> Matrícula
            <%= Html.RadioButton("Tipo", "Nom", false) %> Nome <br />
            <%= Html.TextBox("Pesquisa")%> <br />
            <p>
                <input type="submit" value="Pesquisar" />
            </p>
        </fieldset>
    <% } %>

    <h3> <%= ViewData["Pesquisa"] %> </h3>

    <table>
        <tr>
            <th>Matrícula</th>
            <th>Nome</th>
            <th>Departamento</th>
            <th>Cargo</th>
            <th>Alterar</th>
            <th>Excluir</th>
        </tr>
        <% foreach (var func in Model.lstFunc){ %>
            <tr>
                <td><%= func.Mat %></td>
                <td><%= func.Nom %></td>
                <td><%= func.Depto.Cod + " - " + func.Depto.Dsc %></td>
                <td><%= func.Cargo.Cod + " - " + func.Cargo.Dsc %></td>
                <td><%= Html.ActionLink("Alterar", "Alterar", func) %></td>
                <td><%= Html.ActionLink("Excluir", "Excluir", func) %></td>
            </tr>
        <%} %>
    </table>
</asp:Content>